﻿@model Jingxing.Models.Admin.BannerModel
@{
    ViewBag.Title = "警兴 - 广告大图";
    Model.Caption = "广告大图";
    Model.NewLink = "/Admin/BannerEdit";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@using (Html.BeginForm(new { act = "submit" }))
{
    var grid = new WebGrid(source: Model.List, rowsPerPage: 30);
    @grid.GetHtml(
        htmlAttributes: new { cellpadding = "0", cellspacing = "0" },
        headerStyle: "ui-li ui-li-divider ui-btn ui-bar-a ui-btn-hover-undefined ui-btn-up-undefined",
    columns: grid.Columns
        (
            grid.Column("Name", "名称"),
            grid.Column(header: "图片", format: (item) => Html.Raw(string.Format("<img src='{0}' height=25 width=70>", item.ImageLink == null ? "" : item.ImageLink)), canSort: false),
            grid.Column("Seq", "顺序"),
            grid.Column(header: "编辑",format: (item) => Html.ActionLink("编辑", "BannerEdit", new { id = item.Id }), canSort: false),
            grid.Column(header: "删除", format: (item) => Html.ActionLink("删除", "BannerDelete", new { id = item.Id }), canSort: false)
        )
    )
}